package cn.tedu.springmvc.controller;


import cn.tedu.springmvc.mapper.UserMapper;
import cn.tedu.springmvc.pojo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class HttpController2 {
    @Autowired
    private UserMapper userMapper;
//    查询所有用户信息
    @PostMapping("/getUserAll")
    public String getUser(){
        List<User> userAll = userMapper.getUserAll();
        return userMapper.getUserAll().toString();
    }

}
